package models.vo {

  	import org.restfulx.collections.ModelsCollection;
  	import org.restfulx.models.RxModel;
  
  	[Resource(name="contatos")]
  
  	[Bindable]
  	public class Contato extends RxModel
  	{
    	public static const LABEL			:	String = "logradouro";

    	public var logradouro				:	String;
    	public var numero					:	String;
    	public var bairro					:	String;
    	public var cep						:	String;
    	public var email					:	String;
    	public var telefones				:	String;
    	public var fax						:	String;

    	[BelongsTo]
    	public var municipio				:	Municipio;

    	[HasMany]
    	public var pessoasJuridicas	:	ModelsCollection;
    
		//////////////////////////////////////////////////////////////////////////////////////////////////////
		
    	public function Contato()
    	{
      		super(LABEL);
    	}
    	
		//////////////////////////////////////////////////////////////////////////////////////////////////////
		
    	public function getMunicipio(): Municipio
    	{
    		if (!municipio)
    			municipio = new Municipio();
    			
    		return municipio;
    	}
    	
  	}
}
